#include"public.h"
#include<fstream>
#include"json.hpp"
using json = nlohmann::json;
int main()
{
	DBFactory* factory;
	unique_ptr<Connection> connection;
	unique_ptr<Statement> statement;

	json j;
	ifstream jfile("../settings.json");
	jfile >> j;
	jfile.close();
	//cout << "json j = " << j << endl;
	string dbType = j.at("DB");
	//cout << dbType << endl;
	//factory = make_unique<dbType>();
	factory = s_h_map[dbType]();
	/*if ("MySQL" == dbType)
	{
		factory = make_unique<MySQLFactory>();
	}
	else if ("Oracle" == dbType)
	{
		factory = make_unique<OracleFactory>();
	}*/
	connection = factory->createConnection();
	statement = factory->createStatement();
	connection->connect();
	statement->state();
}